//server.js
var http = require('http');
var querystring = require('querystring');
var url = require('url');
var router = require("./router");
var server = http.createServer(function(req,res){
	var pathname = url.parse(req.url).pathname;
	console.log(pathname);
	var pageContent = router.router(pathname); //将访问路径作为参数传递给路由器
	console.log(pageContent);
	res.writeHead(200, {"Content-Type":"text/html"});
	res.write(pageContent);
	res.end();
});
server.listen(8888);
console.log("Your Server is started @port 8888");